Make the modmap reflexive. (_gdk_keymap_add_virtual_modifiers): Don't add
authorMatthias Clasen <mclasen@redhat.com>
Wed, 7 Sep 2005 01:31:23 +0000 (01:31 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 7 Sep 2005 01:31:23 +0000 (01:31 +0000)
2005-09-06  Matthias Clasen  <mclasen@redhat.com>

* gdk/x11/gdkkeys-x11.c (update_modmap): Make the modmap reflexive.
(_gdk_keymap_add_virtual_modifiers): Don't add both Alt and Meta
if they are mapped to the same modifier.

ChangeLog
ChangeLog.pre-2-10
gdk/x11/gdkkeys-x11.c

index 86f1788855e98decbc410a54645f52f42415cdfa..edafbca20d374cd114c635a38361794e880d7604 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2005-09-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/x11/gdkkeys-x11.c (update_modmap): Make the modmap reflexive.
+       (_gdk_keymap_add_virtual_modifiers): Don't add both Alt and Meta
+       if they are mapped to the same modifier.
+
        * gtk/Makefile.am: Rename gtkstatusicon-x11.c and gtktrayicon.c
        to gtkstatusicon.c and gtktrayicon-x11.c
 
index 86f1788855e98decbc410a54645f52f42415cdfa..edafbca20d374cd114c635a38361794e880d7604 100644 (file)
@@ -1,5 +1,9 @@
 2005-09-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/x11/gdkkeys-x11.c (update_modmap): Make the modmap reflexive.
+       (_gdk_keymap_add_virtual_modifiers): Don't add both Alt and Meta
+       if they are mapped to the same modifier.
+
        * gtk/Makefile.am: Rename gtkstatusicon-x11.c and gtktrayicon.c
        to gtkstatusicon.c and gtktrayicon-x11.c
 
index 531aa17383d66eace04869e39940f9353bec6a08..a1e4b4c30101904013786202474f4d4fe0100071 100644 (file)
@@ -190,6 +190,9 @@ update_modmap (Display      *display,
     for (i = 0; vmods[i].name; i++)
       vmods[i].atom = XInternAtom (display, vmods[i].name, FALSE);
 
+  for (i = 0; i < 8; i++)
+    keymap_x11->modmap[i] = 1 << i;
+
   for (i = 0; i < XkbNumVirtualMods; i++)
     {
       for (j = 0; vmods[j].atom; j++)
@@ -366,6 +369,9 @@ update_keymaps (GdkKeymapX11 *keymap_x11)
       keymap_x11->lock_keysym = GDK_VoidSymbol;
       keymap_x11->group_switch_mask = 0;
       keymap_x11->num_lock_mask = 0;
+
+      for (i = 0; i < 8; i++)
+       keymap_x11->modmap[i] = 1 << i;
       
       /* There are 8 sets of modifiers, with each set containing
        * max_keypermod keycodes.
@@ -1507,7 +1513,7 @@ _gdk_x11_get_group_for_state (GdkDisplay      *display,
 
 void
 _gdk_keymap_add_virtual_modifiers (GdkKeymap       *keymap,
-                                  GdkModifierType  *modifiers)
+                                  GdkModifierType *modifiers)
 {
   GdkKeymapX11 *keymap_x11;
   int i;
@@ -1519,7 +1525,9 @@ _gdk_keymap_add_virtual_modifiers (GdkKeymap       *keymap,
     {
       if ((1 << i) & *modifiers)
         {
-         if (keymap_x11->modmap[i] & GDK_SUPER_MASK)
+         if (keymap_x11->modmap[i] & GDK_MOD1_MASK)
+           *modifiers |= GDK_MOD1_MASK;
+         else if (keymap_x11->modmap[i] & GDK_SUPER_MASK)
            *modifiers |= GDK_SUPER_MASK;
          else if (keymap_x11->modmap[i] & GDK_HYPER_MASK)
            *modifiers |= GDK_HYPER_MASK;